﻿#ifndef UEDGEBUTTON_H
#define UEDGEBUTTON_H

#include "utkwidget_export.h"

#include <QPushButton>
#include <QEvent>

class UEdgeButtonPrivate;
class UTKWIDGET_EXPORT UEdgeButton : public QPushButton
{
    Q_OBJECT
public:
    explicit UEdgeButton(Qt::Orientation orientation, QWidget* parent = nullptr);
    explicit UEdgeButton(QWidget* parent = nullptr);
    ~UEdgeButton();

    void setOrientation(Qt::Orientation orientation);

    void setBackgroundRole(int role);

    void setExpand(bool isExpand);

    bool isExpand();

signals:
    void expandChanged(bool isExpand);

protected:
    void paintEvent(QPaintEvent* event) override;

    QSize sizeHint() const override;

private:
    QScopedPointer<UEdgeButtonPrivate> d_ptr;
    Q_DISABLE_COPY(UEdgeButton)
    Q_DECLARE_PRIVATE_D(d_ptr, UEdgeButton)
};

#endif // UEDGEBUTTON_H
